{% extends 'base.html' %}
{% block page_content %}
<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-tittle">导师列表</h3>
    </div>
    <div class="panel-body">
        <style>
        table { width: 100%; }
        /* 设置第2列的宽度为150像素 */
        table td:nth-child(2) {width: 90px; }
        table td:nth-child(3) {width: 220px; }
        table td:nth-child(4) {width: 200px; }
        </style>
        <table class="table table-bordered table=condensed table-striped table-hover">
            <thead>
              <tr>
                  <th>头像</th>
                  <th>姓名</th>
                  <th>学院</th>
                  <th>专业</th>
                  <th>研究方向</th>
                  <th colspan="2">更多</th>
              </tr>
            </thead>
            <tbody>
            {%for teacher in teachers_list %}
            <tr>
                <td><img src={{teacher.photo}} alt="" width="120px" height="120px"></td>
                <td>{{teacher.name}}</td>
                <td>{{teacher.college}}</td>
                <td>{{teacher.major}}</td>
                <td>{{teacher.direction}}</td>
                <td><a href="/detail/{{ teacher.id }}" class="btn btn-info" >
                    <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span>
                    前往简历
                </a>
                </td>
            </tr>
            {% empty %}
            <tr>
                <td colspan="7">未找到符合条件的教师！</td>
            </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}